<template>
  <div class="down_mian">
    <div class="down_wrap">
      <div>
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path:'/outfit'}">特装</el-breadcrumb-item>
          <el-breadcrumb-item>资料下载</el-breadcrumb-item>
        </el-breadcrumb>
        <div class="upoad_fil">
          <div class="fil_warp">
            <el-checkbox-group class="for_check" v-model="checkList">
              <el-checkbox
              v-for="item in checkdata"
              :key="item.id"
              :label="item.id"
            >
              {{ item.fileName }}
            </el-checkbox>
            </el-checkbox-group>
          </div>
          <div class="fil_but">
            <el-button @click="upoadfill" type="primary">下载</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { stand_info } from "@/api/outfit/exam.js";
import { getToken, setToken } from "@/utils/auth";
export default {
  data() {
    return {
      checkList: [],
      checkdata: [
      ],
    };
  },
  created(){
    this.getdata()
  },
  methods:{
    getdata() {
      let data = JSON.parse(getToken("exhibition"));
      this.checkdata = []
      stand_info(data.id).then((res) => {
      res.rows.forEach((item,index)=>{
        
         if(item.filePos == 1){
           this.checkdata.push(item)
         }
       })
        console.log( this.checkdata);
      });
    },
       // 资料下载
    upoadfill() {
      for (let i = 0; i < this.checkList.length; i++) {
        this.$download.downLoadFile(this.checkList[i]);
      }
    },
  }
};
</script>
<style scoped>
.down_mian {
  background-color: #f2f2f2;
  padding: 20px;
  min-height: 430px;
}
.down_wrap {
  width: 1000px;
  margin: auto;
  background-color: #fff;
  padding: 20px 20px 10px 20px;
  margin-bottom: 30px;
}
.upoad_fil {
  background-color: #fff;
  border: 1px solid #e0e2e6;
  padding: 20px;
}
.for_check {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.fil_but {
  padding: 0 20px;
  display: flex;
  justify-content: flex-end;
}
.fil_warp {
  line-height: 40px;
}
</style>